package com.paranoidmonkey.ode.Joint;

import com.paranoidmonkey.ode.AndrODE;
import com.paranoidmonkey.ode.World;

public class Hinge extends Joint{
	public Hinge(World world,JointGroup group){
		handle=AndrODE.dJointCreateHinge (world.getHandle(), group.groupID);
	}

	public void setAnchor(float x, float y, float z){
		AndrODE.dJointSetHingeAnchor (handle, x, y, z);
	}
	public void setAnchorDelta(float x, float y, float z,float ax, float ay, float az){
		AndrODE.dJointSetHingeAnchorDelta (handle, x, y, z, ax, ay, az);
	}
	public void setAnchor2(float x, float y, float z){
		AndrODE.dJointSetHinge2Anchor (handle, x, y, z);
	}
	public void setAxis(float x, float y, float z){
		AndrODE.dJointSetHingeAxis (handle, x, y, z);
	}
	public void setAxisOffset(float x, float y, float z,float angle){
		AndrODE.dJointSetHingeAxisOffset (handle, x, y, z, angle);
	}
	public void setParam(int parameter, float value){
		AndrODE.dJointSetHingeParam (handle, parameter, value);
	}
	public void addTorque(float torque){
		AndrODE.dJointAddHingeTorque(handle, torque);
	}

	public void getAnchor(float[] result){
		AndrODE.dJointGetHingeAnchor (handle, result);
	}
	public void getAnchor2(float[] result){
		AndrODE.dJointGetHingeAnchor2 (handle, result);
	}
	public void getAxis(float[] result){
		AndrODE.dJointGetHingeAxis (handle, result);
	}
	public float getParam(int parameter){
		return AndrODE.dJointGetHingeParam (handle, parameter);
	}
	public float getAngle(){
		return AndrODE.dJointGetHingeAngle (handle);
	}
	public float getAngleRate(){
		return AndrODE.dJointGetHingeAngleRate (handle);
	}

}
